package com.fenghuajueli.module_home.utils

import com.alibaba.android.arouter.launcher.ARouter
import com.fenghuajueli.libbasecoreui.baseswitch.PublicFunction
import com.fenghuajueli.libbasecoreui.utils.QuickClickUtils
import com.fenghuajueli.module_route.PlayVideoModuleRoute

/**
 * @description
 * @date 2022/11/1
 */

//转换播单
private val videoList = mapOf(
    "627" to "http://bsy-ijj-video.ijianji.cn/bilibili_BV1PS4y1Y73r/BV1PS4y1Y73r_1.mp4",
    "628" to "http://bsy-ijj-video.ijianji.cn/bilibili_BV1PS4y1Y73r/BV1PS4y1Y73r_27.mp4",
    "629" to "http://bsy-ijj-video.ijianji.cn/bilibili_BV1PS4y1Y73r/BV1PS4y1Y73r_57.mp4",
    "630" to "http://bsy-ijj-video.ijianji.cn/bilibili_BV1PS4y1Y73r/BV1PS4y1Y73r_85.mp4",
    "631" to "http://bsy-ijj-video.ijianji.cn/bilibili_BV1PS4y1Y73r/BV1PS4y1Y73r_126.mp4"
)

//跳转视频播放
fun startPlayVideo(url: String, position: Int = -1,itemVid:String = "") {
    if (QuickClickUtils.isFastClick()) {
        return
    }
    if (position != -1) {
    }
    if (videoList.containsKey(url)){
//        ARouter.getInstance().build(PlayVideoModuleRoute.ACTIVITY_VIDEO_URL_PLAY)
//            .withString("url", videoList[url])
//            .navigation()
        ARouter.getInstance().build(PlayVideoModuleRoute.ACTIVITY_VIDEO_LIST_PLAY) //视频 url
            .withString("playListId", url) //相关推荐显示几页
            .withInt("style",3)
            .navigation()
        return
    }
    ARouter.getInstance().build(PlayVideoModuleRoute.ACTIVITY_VIDEO_LIST_PLAY) //视频 url
        .withString("playListId", url) //相关推荐显示几页
        .navigation()
}